/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;


public class YKien {

    String mobileid;
    String name;
    String email;
    String body;

    public YKien(String mobileid, String name, String email, String body) {
        this.mobileid = mobileid;
        this.name = name;
        this.email = email;
        this.body = body;
    }

    public YKien saveYKienCaNhan(String id, String name, String email, String body) {
        Connection conn = ConnectDatabase.getConnection();
        YKien yk = null;
        try {
            String sql = "insert into YKien(mobileid,name,email,body) values(?,?,?,?)";
            PreparedStatement ps = conn.prepareStatement(sql);
            ps.setString(1, id);
            ps.setString(2, name);
            ps.setString(3, email);
            ps.setString(4, body);
            ps.executeUpdate();
            conn.close();

        } catch (SQLException e) {
            e.printStackTrace();
        }
        return yk;
    }


    public String getMobileid() {
        return mobileid;
    }

    public void setMobileid(String mobileid) {
        this.mobileid = mobileid;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
